"""
author:田新宇
create time:2020-07-16
update time:2020-07-17

"""

from django.contrib import admin
from user.models import course,course_user
# class CourseAdmin(admin.ModelAdmin):
#     list_display = ['id','course_name','course_school']#列表显示
#     list_filter = ['course_name']#过滤器
#     search_fields = ['course_name']
#     list_per_page =10


# admin.site.register(course,CourseAdmin)
# admin.site.register(course_user)

from django.contrib import admin
from user.models import course,course_user
class CourseAdmin(admin.ModelAdmin):
    list_display = ['id', 'course_name', 'course_teacher', 'course_type', 'course_school', 'course_status']
    list_filter = ['course_type', 'course_teacher', 'course_school']
    search_fields = ['course_name', 'course_teacher', 'course_school']
    list_per_page = 10

    fields = ['course_name', 'course_school', 'course_teacher', 'course_credit', 'course_type', 'course_time','course_status', 'course_content', 'course_outline', 'course_img']




admin.site.register(course,CourseAdmin)

class CourseUserAdmin(admin.ModelAdmin):
    list_display = ['id','course','user',]
    search_fields = ['user__name','course__course_name','course__course_teacher','course__course_school']

admin.site.register(course_user,CourseUserAdmin)